﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PhotoHsn.BLL.Adapters;


namespace PhotoHsn.BLL
{
    public struct SqlStrrings
    {
        public struct MemberSqlStrings
        {
            public const string LoginSql = @"SELECT * "
                + " FROM Members where "
                //+ Members.ColumnNames.IsActive + " = 1 and "
                + Members.ColumnNames.IsDeleted + " = 0 and "
                + Members.ColumnNames.Password + " = @" + Members.ColumnNames.Password + " and ("
                + Members.ColumnNames.UserName + " = @" + Members.ColumnNames.UserName + " or "
                + Members.ColumnNames.Email + " = @" + Members.ColumnNames.Email + " ) ";

            public const string UserNameControlSql = @"SELECT "
               + Members.ColumnNames.UserName
               + " FROM Members where "
               + Members.ColumnNames.UserName + " = @" + Members.ColumnNames.UserName;
            public const string EmailControlSql = @"SELECT "
              + Members.ColumnNames.Email
              + " FROM Members where "
              + Members.ColumnNames.Email + " = @" + Members.ColumnNames.Email;
            public const string ForgtotPasswordSql = @"SELECT "
                  + Members.ColumnNames.Id + ","
                  + Members.ColumnNames.Password + ","
                  + Members.ColumnNames.SecurityQuestionId + ","
                  + Members.ColumnNames.SecurityResponse
              + " FROM Members where "
              + Members.ColumnNames.Email + " = @" + Members.ColumnNames.Email;
        }

        public struct RoleSqlStrings
        {
            public const string AuthoritySql = @"select "

                  + " r." + Roles.ColumnNames.Name + " from MemberRoles mr "
                  + " inner join Roles r on r." + Roles.ColumnNames.Id + "=mr." + MemberRoles.ColumnNames.RoleId + " and r." + Roles.ColumnNames.TypeId + "=@" + Roles.ColumnNames.TypeId + " and r." + Roles.ColumnNames.IsActive + "=1 and r." + Roles.ColumnNames.IsDeleted + "=0"
                  + " Where "
                  + " mr." + MemberRoles.ColumnNames.MemberId + "=@" + MemberRoles.ColumnNames.MemberId
                  + " and mr." + MemberRoles.ColumnNames.IsActive + "=1 "
                  + " and mr." + MemberRoles.ColumnNames.IsDeleted + "=0 ";
        }

        public struct BrandSqlStrings
        {
            public const string WithEquipmentType = @"select * From Brands "
                 + " Where "
                 + Brands.ColumnNames.EquipmentTypeId + " =@" + Brands.ColumnNames.EquipmentTypeId
                 + " and " + Brands.ColumnNames.IsActive + "=1 "
                 + " and " + Brands.ColumnNames.IsDeleted + "=0 ";
        }
    }
}
